﻿using MediatR;
using SheepStorage.API.Application.Command.SheepHybridizationCommand;
using SheepStorage.API.Baseclass;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Application.CommandHandlers.SheepHybridizationCommandHandler
{
    public class DelSheepHybridzationCommandHandler : IRequestHandler<DelSheepHybridzationCommand, Results<int>>
    {
        ISheepHybridizationService _res;

        public DelSheepHybridzationCommandHandler(ISheepHybridizationService res)
        {
            _res = res;
        }

        public async Task<Results<int>> Handle(DelSheepHybridzationCommand request, CancellationToken cancellationToken)
        {
            var list = await _res.DelSheepHybridzation(request.ids);
            return Results<int>.DataResult(list);
        }
    }
}
